package com.hfy.user.controller;

import com.hfy.model.dto.user.FollowDto;
import com.hfy.user.service.FollowService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

/**
 * @ author 韩
 * time: 2024/10/29 15:31
 */

@RestController
@Tag(name = "关注粉丝业务的控制器" ,description = "基于粉丝与被关注者之间的关系实现的各种操作")
@RequestMapping("/fans")

public class FollowController {

    @Autowired
    private FollowService followService;

    @PostMapping("/follow")
    @Operation(summary = "关注")
    @Parameters({@Parameter(name = "doFollow", description = "决定进行关注操作还是取消关注操作"),
            @Parameter(name = "fansAccount", description = "发起关注的账号"),
            @Parameter(name = "idolAccount", description = "被关注的账号")})
    public Result follow(@RequestBody FollowDto dto) {
        return followService.follow(dto);
    }

}
